<?php
require_once('model/Image.php');

class Image extends DataObjects_Image
{
	
	/**
	 * Get all Image
	 *
	 * @return Image object
	 */
	public function getList($filter = array(), $pagination = true){
		
		$image = new Image();		
		
		if(isset($filter['garage_id']) && $filter['garage_id']){
			$image->garage_id = $filter['garage_id'];
		}
		
		if($pagination){
			$p = new FRM_Pager('page',Parameter::$params["PAGING_DEFAULT_ITEM_PER_PAGE"], new FRM_Pager_RangeIterator(1, Parameter::$params['PAGING_DEFAULT_PAGE_DELTA'], 1));
			$image->setPager($p);
		}
		$image->orderBy('id');
		$image->find();
		
		return $image;
	}

}
?>